package August;

import java.util.Scanner;

public class Day0811 {

    /**
     *	正数数组中的最小不可组成和
     *	输入：正数数组arr
     *	返回：正数数组中的最小不可组成和
     */
//    public int getFirstUnFormedNum(int[] arr) {
//    }

    /**
     * 有假币
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            if (n == 0){
                break;
            }
            int count =0;
            while (n != 0){
                if (n == 1)
                    break;

                if (n % 3 == 0){
                    n = n/3;
                }else {
                    n = n/3 +1;
                }
                count++;
            }
            System.out.println(count);
        }
    }
}
